# This class can be used to keep difference statistics about each device to be used.
# Assuming one wireless router in the home
import datetime
import time

# This class can  be used for the device statistics
class DeviceStat: 
    def __init__(self,mac,first_registered):
        self.dev_id = mac
        self.first_registered = first_registered  # When did this device appeared on the radar. Static variable updated once.
        self.last_appeared= None 
        self.total_online_time = None
        self.time_till_last_use = None
        self.app_list = []  # List of applications that the device has used 
        self.cur_app_list = [] # Current applications list used by the device
        self.app_stat = {} # Dict to manage the stat about different applications used by the device.
        self.cur_app_stat = {} #Dict to manage the stat about differnt application used by the deivce since it last registered.
        pass

    def set_last_appeared(self,mac):
        pass

    #--
    # Return first appearance time 
    #--
    def get_first_registered(self):
        return self.first_registered
    
    #--
    # To uiquely identify the objects
    #--
    def getDeviceID(self):
        return self.dev_id

    def get_last_appeared(self,mac):
        pass

    def set_total_time_online(self):
        pass

    # --
    # Prints
    # --
    def printDevStat(self):
        print "Device First seen:  ", self.first_registered.strftime("%Y-%m-%d %H:%M:%S")
        pass




